1. Field of the Invention
The present invention relates to a technology for recording encoded video/audio data on a storage medium such as an optical disk, a hard disk, a memory card or the like, and reproducing the recorded video/audio data.
2. Description of the Related Art:
In order to compress video data at a low bit rate, the MPEG-2 standard (ISO/IEC 13818-1) provides three types of streams, i.e., a program stream, a transport stream, and a PES (Packetized Elementary Stream).
Such a system stream is, for example, written on an optical disk and stored thereon. An optical disk is a storage medium of video data replacing a magnetic tape. As optical disks, phase change optical discs including DVD-RAM discs and Blu-ray discs, and magneto-optic discs including MO discs are known.
For example, as a format for recording video data on a DVD-RAM disc, VIDEO RECORDING format (DVD Specifications for Rewritable/Re-recordable Discs Part 3 VIDEO RECORDING Version 1.0 September 1999) is provided. According to this format, a video data file is recorded on a DVD-RAM disc in the MPEG-2 program stream format.
A format for recording video data on a Blu-ray disc has also been provided. According to this standard, a video data file is recorded in the MPEG-2 transport stream format provided in ISO/IEC 13818-1. In a transport stream, video data is compressed by the MPEG-2 system provided in ISO/IEC 13818-2, and audio data is compressed by, for example, the MPEG-2-AAC (Advanced Audio Coding) system provided in ISO/IEC 13818-7.
FIG. 1 shows a data structure of video data which is recorded on a phase change optical disc 131 on a real time basis. In FIG. 1, the phase change optical disc 131 includes 2 kilobyte sectors. A group of each 16 sectors is treated as one logical block. Each logical block is provided with an error correction code, and is recorded on the phase change optical disc 131. This data structure is disclosed in, for example, Japanese Laid-Open Patent Publication No. 11-155130.
A physically continuous logical block having a data size of at least a predetermine time period (for example, data of 11 seconds when converted at the maximum recording/reproduction rate) is saved as one continuous data area. In this area, unit video packets (Video OBject UNITs: hereinafter, a Video OBject UNIT will be referred to as a “VOBU”), each including an MPEG transport stream of 0.4. to 1 second, are sequentially recorded.
One VOBU includes a plurality of 188-byte transport packets, which are at a lower level of an MPEG transport stream. The transport packet is available in four types, i.e., a video transport packet (V_TSP) having compressed video data stored therein, an audio transport packet (A_TSP) having compressed audio data stored therein, a transport packet (PAT_TSP) having a program association table packet (PAT) stored therein, and a transport packet (PMT_TSP) having a program map table (PMT) stored therein.
One VOBU includes V_TSPs regarding pictures which are reproduced over a predetermined period. One VOBU also includes all A_TPSs including audio frames required in relation to the video reproduction. Namely, audio frames are completed in one VOBU. The data size of one VOBU changes within a range of the maximum recording/reproduction rate when the bit rate of the video data is variable; whereas the data size of one VOBU is substantially constant when the bit rate of the video data is fixed.
FIGS. 2A through 2E respectively show, in detail, a V_TSP without a PCR, an A_TSP, a PAT_TSP, a PMT_TSP, and a V_TSP with a PCR. A V_TSP includes a transport packet header and video data. An A_TSP includes a transport packet header and audio data. A PAT_TSP mainly includes a transport packet header and a program association table. A PMT_TSP mainly includes a transport packet header and a program map table. As shown in FIG. 2E, when a PCR (program clock reference) is added to a V_TSP, a PCR value is recorded in an adaptation field adjacent to the transport packet header.
The V_TSP, the A_TSP, the PAT_TSP, and the PMT_TSP are identified by a PID (Packet ID) included in the respective transport packet header. For example, as shown in FIGS. 2A through 2D, the PID of the V_TSP is “0x0020”, the PID of the A_TSP is “0x0021”, the PID of the PAT_TSP is “0x0000”, and the PID of the PMT_TSP is “0x0030”. Once the PID value is detected, the type of the packet is identified.
The PIDs assigned to the V_TSP and the A_TSP are described in the program map table in the PMT_TSP. The PID assigned to the PMT_TSP is described in the program association table in the PAT_TSP. The PID of the PAT_TSP is fixed to “0x0000”.
A PCR is a 27 MHz clock sample value, which indicates the time when the corresponding transport packet reached a virtual MPEG decoder. The MPEG-2 standard (ISO/IEC 13818-1) regulates that a PCR should be inserted to a transport packet having a specific PID at an arbitrary interval equal to or less than 100 msec.
In a PCR_PID field of the PMT, the PID of which has been selected for describing the PCR is recorded. An apparatus which has received a stream inputs this PCR value to the 27 MHz clock to provide a PLL (Phase Locked Loop). The apparatus also uses the PCR value to obtain a reference presentation time stamp (PTS) and a reference decoding time stamp (DTS). Namely, the apparatus sets the PCR value as the initial value of the 27 MHz clock, and thereafter inputs the PCR value to the PLL to use the PCR value as the clock on the transmission side. The apparatus decodes video data at the timing when the clock value matches the decoding time stamp (DTS) or the presentation time stamp (PTS) included in the video data, and displays a video based on the video data. Audio data is different from the video data in including only a PTS. Like in the case of video data, audio data is decoded and output at the timing when the clock value matches the PTS.
When one continuous data area becomes close to full of data, the apparatus detects the next continuous data area. When the one continuous data area becomes full, data is written in the next continuous data area.
FIG. 3 shows an example of data on an optical disc which is managed by the UDF (Universal Disc Format) file system. In FIG. 3, one MPEG transport stream is recorded as a file MOVIE.MPG by turning the recording start button on once and off once.
As shown in FIG. 3, the file names and the position of a file entry are managed by an FID (File Identifier Descriptor). One file and three continuous data areas a, b and c included in that file are managed by an allocation descriptor in the file entry.
The file is recorded in three data areas as follows. When the apparatus detects a defective logical block while recording data on the continuous data area a, the apparatus skips the defective logical block and resumes recording the data from the start of the continuous data area b.
When the apparatus detects a recording area of a PC file while recording data on the continuous data area b, the apparatus skips the recording area of the PC file and resumes recording the data from the start of the continuous data area c. As a result, the file MOVIE.MPG includes three data areas a, b and a.
FIG. 4 shows the relationship among a VOBU, transport packets thereof, a video elementary stream and an audio elementary stream. In this example, one VOBU includes M number of GOPs (Group of Pictures).
Each of video and audio frames includes a PES header. One VOBU includes a sequence header at the start thereof. Each GOP includes a GOP header.
In each VOBU, the first video PES header and the first audio PES header are adjusted to commence at the start of the payload of the respective transport packet. Specifically, padding data is inserted into the immediately previous transport packet, so that the size of the respective transport stream is adjusted.
A PAT_TSP and a PMT_TSP respectively include PIDs of the packets having video data or audio data. Accordingly, unless these two PIDs are recognized, the video and the audio cannot be reproduced.
In order to control the decoding timing and the output timing based on the PTS and DTS at the time of decoding, it is necessary to initialize the value of the 27 MHz clock at the earliest possible time. In order to realize this, it is necessary that the MPEG decoder should receive the PCR value as soon as possible and start using the clock value.
A specific structure for recording the above-described video data and audio data on a phase change optical disc is described in, for example, International Publication WO02/080541.
The MPEG-2 standard (ISO/IEC 13818-1) does not provide the timing to insert a PAT_TSP, a PMT_TSP or a PCR. The frequency of inserting the PCR is provided, but the frequency of inserting the PAT_TSP or PMT_TSP is not provided.
Most of reproduction apparatuses for reproducing the video recorded on a disc have a function of reproducing specific scenes of the video in an order favored by the user. For reproducing the video from a specific scene, the reproduction of the video data is generally started from the start of the sequence header.
In general, however, the timing to insert the PAT_TSP, the PMT_TSP or the PCR with respect to a V_TSP including the start of the sequence header used as a reproduction start point is not provided. Even if the apparatus reads the data from the start of the sequence header, the V_TSP or the A_TSP cannot be recognized by referring to the PID thereof unless the PAT_TSP and the PMT_TSP are detected. Accordingly, the decoding cannot be performed until the PAT_TSP and the PMT_TSP are detected.
As described above, when, for example, the I picture immediately after the sequence header is not recognized because the PAT_TSP and the PMT_TSP are undetected, the video cannot be displayed until the next sequence header. As a result, typically, neither video data nor audio data is output for about 0.5 to 1.0 second.
For reproducing specific scenes while sequentially switching the specific scenes, the PIDs registered in the PAT_TSP and the PMT_TSP may be different scene by scene. The descriptor information included in the PAT_TSP and the PMT_TSP may be different scene by scene. Therefore, appropriate PAT_TSP and PMT_TSP need to be transferred to the MPEG decoder at the earliest possible time at least scene by scene.
Especially when data is transferred to an STB (set top box) or a DTV (digital TV) connected by the IEEE1394 interface using the transfer protocol of the SIO-61883 transport stream, transfer of the PAT_TSP, the PMT_TSP and the PCR is important. The reason is that there is no means for transferring, for example, the used PIDs and PCR values separately from the transport stream.
When reproducing data using the MPEG decoder of an apparatus, it is conceivable to transfer, for example, the used PIDs and PCR values in the state of being converted into a different data structure using a different return path from the path used for the MPEG stream (for example, via a CPU connected to the MPEG decoder).
However, in order to transfer information necessary for each scene by the different path, it is necessary to record information on the PID and information on the first PCR value of each VOBU at the time of recording and to transfer such information to the MPEG decoder before one scene is switched to the next scene. Such a method requires the PID and the PCR value of each VOBU to be recorded as management data, which enlarges the data capacity. In addition, such a method causes a processing delay. Therefore, this method is not sufficient for using the MPEG decoder of the apparatus to reproduce the video and simultaneously output the video signal to the IEEE1394 interface and also for displaying exactly the same video at both of the output destinations.
Conventionally, there is also a problem in reproducing a stream accumulated on a hard disc of a PC using an MPEG reproduction application operable on the PC. Specifically, when the video reproduction is to be started from a specific scene, if the PAT_TSP, the PMT_TSP and the PCR are recorded from the middle of the scene, the video is displayed from the position after the scene at which the first sequence header is detected. In order to avoid this, it is necessary to detect the PAT_TSP, the PMT_TSP and the PCR inserted after the data corresponding to the reproduction start point and then return to the reproduction start point to start the reproduction. This delays the reproduction and scene switching.
Conventionally, there is further a problem in copying or dubbing an MPEG stream to another recording medium. Specifically, when the data structure of management information of an MPEG stream needs to be converted, it is necessary to analyze the MPEG stream of, for example, each VOBU, and generate management information recordable on the storage medium to which the data is to be copied or dubbed. This possibly requires an enormously long processing time. This problem occurs also in transferring the MPEG stream on the recording medium, from which the data is to be copied or dubbed, with no conversion.